<?php
/**
 * Author: 式神(vashi)
 * email: 289650682@qq.com
 * Date: 2019/2/20 10:12
 * FileName: Category.php
 */

namespace app\cms\model;


class Category extends Common
{
    protected $tip_name = '栏目';
    protected $validate;
    protected $table;

    public function initialize()
    {
        parent::initialize();
        $this->validate = new \app\cms\validate\Category();
    }

    //添加规则
    public function add($input){
        if(!isset($input['status']) || !$input['status']){
            $input['status']=0;
        }
        if(!isset($input['sort']) || !$input['sort']){
            $input['sort']=0;
        }
        return $this->addModel($input);
    }

    //编辑规则
    public function edit($input){
        if(!isset($input['status']) || !$input['status']){
            $input['status']=0;
        }
        if(!isset($input['sort']) || !$input['sort']){
            $input['sort']=0;
        }
        return $this->editModel($input);
    }

    public function del($input){
        return $this->delModel($input);
    }
}